<%@page import="org.springframework.web.bind.annotation.SessionAttributes"%>
<%@page import="com.base.common.util.RelativeDateFormat"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!doctype html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
	<title>爱笔记</title>
	
	<%@include file="/include/header.jsp" %>
	
</head>

<body id="lovenote">
	<!-- Top menu begin -->
	<%@include file="/include/menu.jsp" %>
	<!-- Top menu End -->
	
	<%@include file="/include/sidebar.jsp" %>

	<div class="main container">
		<div class="ui grid">
			<!-- start content -->
			<div class="eleven wide column">

				<!-- Feed list begin -->
				<div class="ui message feed">
					<c:choose>
						<c:when test="${hasNoteList == true }">
							<c:forEach items="${noteList }" var="note" varStatus="status">
								<div class="event">
										<div class="label">
										<img src="${sessionScope.avatar }">
									</div>
									<div class="content">
										<div class="date">
											<c:set value="${note.dateline}" var="dateline"></c:set>
											<% 
												 out.println(RelativeDateFormat.format(pageContext.getAttribute("dateline").toString())); 
											%>
										</div>
										<div class="summary">
											<a href="info.html">${note.author }</a>&nbsp;添加了新笔记：<!-- &nbsp;<a href="content.html">YAF路由问题</a> -->
										</div>
										<div class="extra text">
											${note.content }
										</div>
										<div class="note bottom">
											<div class="category">
												<i class="icon tags"></i>&nbsp;${noteCatalogMap[note.catalogId] }
											</div>
											<div class="reply">
												<i class="book icon"></i>&nbsp;阅读(${note.viewNumber })&nbsp;
												<a href=""><i class="icon chat"></i>&nbsp;评论(${note.commentNumber })</a>&nbsp;
												<a href=""><i class="icon right"></i>&nbsp;查看全部</a>
											</div>
											<div class="clear"></div>
										</div>
									</div>
								</div>
								<div class="ui divider"></div>	
							</c:forEach>
						</c:when>
						<c:otherwise>
							您还没有笔记，赶快写笔记吧！
						</c:otherwise>
					</c:choose>
					

					<%@include file="/include/page.jsp" %>
				</div>
				<!-- Feed list end -->
			</div>
			<!-- end content -->
	
			<div class="five wide column">
				
				<!-- User information begin -->
				<%@include file="/include/user_info.jsp"%>
				<!-- User information end -->

				<!-- catalog list begin -->
				<%@include file="/include/catalog_list.jsp" %>
				<!-- catalog list end -->

				<!-- Newest note begin -->
				<%@include file="/include/new_note.jsp" %>
				<!-- Newest note end -->
			</div>
		</div>
		
		<%@include file="/include/footer.jsp" %>
	</div>
</body>
</html>